package com.library.web.controller.api;

import com.library.common.core.controller.BaseController;
import com.library.common.core.domain.AjaxResult;
import com.library.domain.AppActivity;
import com.library.service.IAppActivityService;
import com.library.vo.AppActivityModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author julyWhj
 * @Description $
 * @Date 2022/3/28 4:42 下午
 **/
@RestController
@RequestMapping("/api/activity")
public class ActivityApiController {
    @Autowired
    private IAppActivityService activityService;

    /**
     * 根据活动编号查询
     *
     * @param activityNo 活动编号
     * @return 活动详情
     */
    @GetMapping
    public AjaxResult getActivityByActivityNo(String activityNo) {
        AppActivity appActivity = activityService.selectAppActivityByActivityNo(activityNo);
        return AjaxResult.success(AppActivityModel.toModelDetails(appActivity));
    }

    
}
